var map = new BMap.Map("allmap");
map.centerAndZoom(points[0], 16);        // 设置中心点及缩放级别

var marker = [];
for (var i = 0; i != points.length; i++) {
    marker.push(new BMap.Marker(points[i], {title:time[i]})); // 创建标注
    map.addOverlay(marker[i]);                         // 将标注添加到地图中
}

var polyline = new BMap.Polyline(points, {strokeColor:"blue", strokeWeight:5, strokeOpacity:0.5});
map.addOverlay(polyline);

var infoWindow = new BMap.InfoWindow("<h4>Current location</h4><p>Longitude: "+points[0].lng+"<br>Latitude: "+points[0].lat+"</p>");
marker[0].addEventListener("click", function(){this.openInfoWindow(infoWindow);});
marker[0].setAnimation(BMAP_ANIMATION_BOUNCE);

map.enableDragging();               //启用地图拖拽事件，默认启用(可不写)
map.enableScrollWheelZoom();        //启用地图滚轮放大缩小
map.disableDoubleClickZoom();       //禁用鼠标双击放大
//向地图中添加缩放控件
var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
map.addControl(ctrl_nav);
//向地图中添加缩略图控件
var ctrl_ove = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1});
map.addControl(ctrl_ove);
//向地图中添加比例尺控件
var ctrl_sca = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(ctrl_sca);
